<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Detect MIME Content-type for a file (deprecated)</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.finfo-set-flags.html">finfo_set_flags</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.filesystem.html">Filesystem</a></div>
 <div class="up"><a href="ref.fileinfo.html">Fileinfo 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mime-content-type" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mime_content_type</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">mime_content_type</span> &mdash; <span class="dc-title">Detect MIME Content-type for a file (deprecated)</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.mime-content-type-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>mime_content_type</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns the MIME content type for a file as determined by using
   information from the <var class="filename">magic.mime</var> file. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mime-content-type-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">filename</code></em></dt>

     <dd>

      <p class="para">
       Path to the tested file.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mime-content-type-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the content type in MIME format, like 
   <em>text/plain</em> or <em>application/octet-stream</em>.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mime-content-type-notes">
  <h3 class="title">注释</h3>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="para">
    This function has been deprecated as the PECL extension
    <a href="ref.fileinfo.html" class="link">Fileinfo</a> provides the same
    functionality (and more) in a much cleaner way.
   </p>
  </div>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mime-content-type-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2282">
    <p><strong>Example #1 <span class="function"><strong>mime_content_type()</strong></span> Example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">mime_content_type</span><span style="color: #007700">(</span><span style="color: #DD0000">'php.gif'</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #0000BB">mime_content_type</span><span style="color: #007700">(</span><span style="color: #DD0000">'test.php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
image/gif
text/plain
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.mime-content-type-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member">
     <a href="ref.fileinfo.html" class="link">Fileinfo</a> for a replacement
    </li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.finfo-set-flags.html">finfo_set_flags</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.filesystem.html">Filesystem</a></div>
 <div class="up"><a href="ref.fileinfo.html">Fileinfo 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
